<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="assetMenu" />
<meta name="nav" content="1" />
<meta name="acc" content="_assets" />
<style type="text/css">

</style>
<title>资产管理  > 办公用品</title>
<!--  通用情况下 不引入 js css  表单验证  js 放置到页面中 -->
<script>
		$(document).ready(function() {
		 $("input[name='buydate']").addClass("Wate").bind("click", function(){
    	 WdatePicker({skin:'whyGreen',minDate:'1900-10-01',maxDate:'#F{$dp.$D(\'recorddate\')||\'%y-%M-%d\'}',dateFmt:'yyyy-MM-dd'});});
		 $("input[name='recorddate']").addClass("Wate").bind("click", function(){
    	 WdatePicker({skin:'whyGreen',minDate:'#F{$dp.$D(\'buydate\')}',maxDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd'});});
		 $("#sindex").focus();
			//为inputForm注册validate函数
		 if('${price}'){
			 $("#fmtPrice").formatCurrency(); 
		 }
		 $("#fmtPrice").blur(function(){
			 $("#price").val($("#fmtPrice").val());
             $("#fmtPrice").formatCurrency();
      	});

 		 $("#inputForm").validate({
			 		event:"blur",
			 		rules: {
			 		sindex:"required",
			 		officer: "required",
					name: {
						required: true,
					},
					fmtPrice:{
						required: true
					},
					code:{
						required: true ,
						remote:"information!findByUniqueCode.action?oldCode="+encodeURI('${code}')
					},
					buydate :"required"
				}
			});
		});
	</script>
</head>
<body>
<form action="${ctx}/asset/assets/information!save.action" method="post" id="inputForm"
	class='yform'>
<div id="caption" ><h6>办公用品信息</h6></div>
<table class="noborder">
	<tr class="type-title">
		<td colspan="4" >基本信息</td>
	</tr>
	<tr class="type-text">
		<td>编号</td>
		<td><input id="sindex" name="sindex"   
			type="text" value="${sindex}" /></td>
		<td>资产编号</td>
		<td><input type="text" name="code" value="${code}" /></td>
	</tr>
	
	<tr class="type-text">
		<td>资产名称</td>
		<td><input id="name" name="name"   
			type="text" value="${name}" /> <input type="hidden"
			id="id" name="id" value="${id}" />
			<input type="hidden" id="type" name="type" value="1" /></td>
		<td>产品品牌</td>
		<td><input type="text" name="brand" value="${brand}" /></td>
	</tr>

	<tr class="type-text">
		<td>数量</td>
		<td><input type="text" name="count" value="${count}" /></td>
		<td>单位</td>
		<td><input type="text" name="unit" value="${unit}" /></td>
	</tr>
	
	<tr class="type-text">
		<td>状态</td>
		<td>
		<pt:code category="2019" name="asstState" default="${asstState}"></pt:code>
		</td>
		<td>规格型号</td>
		<td><input type="text" name="model" value="${model}" /></td>
	</tr>
	<tr class="type-select">
		<td>金额</td>
		<td><input type="text" id="fmtPrice" name="fmtPrice" value='${price}'/>
		<input type="hidden" id="price" name="price" value='${price}'/></td>
		<td>产品编号</td>
		<td><input type="text" name="productNo" value="${productNo}" /></td>
	</tr>
	<tr class="type-title">
		<td colspan="4">存档信息</td>
	</tr>
	<tr class="type-text">
		<td>所属部门</td>
		<td><pt:labels type="insideOrgDept" name="deptId" default="${dept.id}" hasEmpty="false" ></pt:labels></td>
		<td>购置人</td>
		<td><input type="text" name="buyer"
			value="${buyer}" /></td>
	</tr>
	<tr>
		<td>入账日期</td>
		<td class="type-text" ><input id="buydate" type="text"
			name="buydate" value="${buydate}" readonly="readonly" /></td>
		<td>存放地</td>
		<td><input type="text" name="stored" value="${stored}" /></td>
	</tr>
	<tr class="type-text">
		<td>登记人</td>
		<td><input type="text" name="recorder" value="${recorder}" /></td>
		<td>登记时间</td>
		<td class="type-text" ><input id="recorddate" type="text"
			name="recorddate" value="${recorddate}" readonly="readonly" /></td>
	</tr>
	<tr class="type-text">
		<td>责任人</td>
		<td><input type="text" name="officer" value="${officer}" /></td>
	</tr>
	<tr class="type-text">
		<td>备注</td>
		<td colspan="3"><textarea rows="5" name="remark" cols="30">${remark}</textarea>
		</td>
	</tr>
</table>
<div class="type-button"><input  type="submit"
	class="submit" value="提交" />&nbsp; <input  type="button"
	value="返回" class="reset" onclick="history.back()" /></div>
</form>
</body>
</html>
